<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 


<script>
$(function(){
    $("#dealerIndexLevelSelectId").val("${viewRequest.params['_and_dl_dot_level_eq_number'] }");
});
</script>

<!--      建议使用分辨率： 、navTab -->
<style>
.dealerIndexUl { display:block; overflow:hidden; height:25px;}
.dealerIndexUl li { float:left; display:block; overflow:hidden; width:auto; height:21px; padding:2px 0;}
</style>


<form id="pagerForm" method="get" model="viewRequest" action="#rel#">
	<input type="hidden" name="viewRequest.page" value="${page.number}" />
	<input type="hidden" name="viewRequest.size" value="${page.size}" />
	<c:forEach items="${viewRequest.params}" var="params">
		<input type="hidden"  name="viewRequest.params['${params.key}']" value="${params.value}" />
	</c:forEach>
	<c:forEach items="${viewRequest.sort}" var="sort">
		<input type="hidden" name="viewRequest.sort['${sort.key}']" value="${sort.value}" />
	</c:forEach>
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="${rootUrl}/member/dealer" method="get">
	<div class="searchBar">
		<ul class="dealerIndexUl">
			<li>
				分销商名称：
				<input type="text" name="viewRequest.params['_and_d_dot_name_like']" value="${viewRequest.params['_and_d_dot_name_like']}"/>
			</li>
			<li>
				级别：
				<select name="viewRequest.params['_and_dl_dot_level_eq_number']" id="dealerIndexLevelSelectId">e
					<option value="">全部</option>
					<c:forEach items="${dealerLevelList }" var="dl">
					<option value="${dl.level }">${dl.name }</option>
					</c:forEach>
				</select>
			</li>
			<li>
				域名：
				<input type="text" name="viewRequest.params['_and_d_dot_domain_like']" value="${viewRequest.params['_and_d_dot_domain_like']}"/>
			</li>
			<li>
				会员名称：
				<input type="text" name="viewRequest.params['_and_m_dot_name_like']" value="${viewRequest.params['_and_m_dot_name_like']}"/>
			</li>
			<li>
				<label>时间：</label>
				<input name="viewRequest.params['_and_d_dot_createdAt_ge_string']" type="text" class="date" size="20" value="${viewRequest.params['_and_d_dot_createdAt_ge_string'] }" placeholder="开始时间"/>
				<input name="viewRequest.params['_and_d_dot_createdAt_le_string']" type="text" class="date" size="20" value="${viewRequest.params['_and_d_dot_createdAt_le_string'] }" placeholder="结束时间"/>
			</li>
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>

<div class="pageContent">
	<table class="table" targetType="dialog"  width="100%" layoutH="110">
		<thead>
			<tr>
				<th width="30" align="center" >序号</th>
				<th width="120">分销商名称</th>
				<th width="50">级别</th>
				<th width="100">二级域名</th>
				<th width="120">会员名称</th>
				<th width="150">创建时间</th>
				<th width="40">二级人数</th>
				<th width="40">三级人数</th>
				<th width="100">上级</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.content}" var="dealer" varStatus="status">
			<tr>
				<td>${status.count}</td>
 				<td>${dealer[2]}</td>
 				
 				<td>
 				<c:forEach items="${dealerLevelList }" var="level">
 				<c:if test="${dealer[3] == level.level}">${level.name }</c:if>
 				</c:forEach>
 			    </td>
 			    
 				<td>${dealer[6]}</td>
 				<td>${dealer[13]}</td>
				<td><fmt:formatDate value="${dealer[7]}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
 				<td>${dealer[9]}</td>
 				<td>${dealer[10]}</td>
				<td><a title="查看详情" target="dialog" rel="member_detail" width="1000" height="600" href="${rootUrl}/member/member/${dealer[11]}/detail" >${dealer[12]}</a></td>
				<td>
					<a title="升级为代理"  target="dialog" rel="dealer_upgradeTop" width="1000" height="600" href="${rootUrl}/member/dealer/${dealer[0]}/upgradeTopUI" >升级分销商</a>
				    <a title="分销商详情" target="dialog" rel="dealer_detail" width="1000" height="600" href="${rootUrl}/member/dealer/${dealer[0]}/detail" >分销商详情</a>
				    <a title="会员详情" target="dialog" rel="member_detail" width="1000" height="600" href="${rootUrl}/member/member/${dealer[1]}/detail" >会员详情</a>
				    <a title="下级分销商" target="dialog" width="1000" height="600" rel="theDealer_${dealer[1]}" href="${rootUrl}/member/dealer/${dealer[1]}/subDetail" >下级分销商</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="${page.size}">${page.size}</option>
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共${page.totalElements}条 </span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${page.totalElements}" numPerPage="${page.size}" pageNumShown="10" currentPage="${page.number}"></div>
	</div>
</div>
